<template name="createChat">
    <div class="modal-content">
        <h2>Select the contacts you want to chat with</h2>
        {{#if ready}}
            {{#each contacts}}
                {{>addContactToChatItem}}
            {{/each}}
            {{#unless contacts}}
                <div class="no-content">
                    <div>
                        <p>You have no friends yet.</p>
                        <p>Click here to send out some friend requests.</p>
                        <div class="btn waves-effect" data-action="addContacts">add friends</div>
                    </div>
                </div>
            {{/unless}}
        {{else}}
            <div class="main-loading">
                {{> loading size="small"}}
            </div>
        {{/if}}
    </div>
    <div class="modal-footer">
        <button id="createChat" class="btn-flat on-white waves-effect">
            create
        </button>
        {{> dialogAbortButton text="abort"}}
    </div>
</template>

<template name="addContactToChatItem">
    <div class="list-item with-divider">
        <div><img src="{{gravatar}}" class="circle"></div>
        <div class="truncate">{{username}}<span class="user-status">{{> userStatus}}</span></div>
        <div>
            {{#if selected}}
                <i class="material-icons">check</i>
            {{/if}}
        </div>
    </div>
</template>
